home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / DJGPP / DJDEV111.ZIP / include / std.h < prev    next >
C/C++ Source or Header  |  1993-11-28  |  9KB  |  295 lines

  1. /* This is file std.h */
  2. /* This file may have been modified by DJ Delorie (Jan 1991).  If so,
  3. ** these modifications are Coyright (C) 1991 DJ Delorie, 24 Kirsten Ave,
  4. ** Rochester NH, 03867-2954, USA.
  5. */
  6.  
  7. /* This may look like C code, but it is really -*- C++ -*- */
  8. /* 
  9. Copyright (C) 1988 Free Software Foundation
  10.     written by Doug Lea (dl@rocky.oswego.edu)
  11.  
  12. This file is part of GNU CC.
  13.  
  14. GNU CC is distributed in the hope that it will be useful,
  15. but WITHOUT ANY WARRANTY.  No author or distributor
  16. accepts responsibility to anyone for the consequences of using it
  17. or for whether it serves any particular purpose or works at all,
  18. unless he says so in writing.  Refer to the GNU CC General Public
  19. License for full details.
  20.  
  21. Everyone is granted permission to copy, modify and redistribute
  22. GNU CC, but only under the conditions described in the
  23. GNU CC General Public License.   A copy of this license is
  24. supposed to have been given to you along with GNU CC so you
  25. can know your rights and responsibilities.  It should be in a
  26. file named COPYING.  Among other things, the copyright notice
  27. and this notice must be preserved on all copies.  
  28. */
  29.  
  30.  
  31. #ifndef _std_h
  32. #define _std_h 1
  33.  
  34. #include <stddef.h>
  35.  
  36. #include <sys/types.h>
  37.  
  38. #ifndef offsetof
  39. #define offsetof(type,rec) ((int)(&(((type *)0)->rec)))
  40. #endif
  41.  
  42. struct tm;
  43.  
  44.  
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif
  48. volatile void _exit(int);
  49. volatile void abort(void);
  50. int       abs(int);
  51. int       access(const char*, int);
  52. int       acct(const char*);
  53. unsigned  alarm(unsigned);
  54. int       atexit(void (*)(void));
  55. double    atof(const char*);
  56. int       atoi(const char*);
  57. long      atol(const char*);
  58. /* int       bind(int, void*, int); POHC */
  59. int       brk(void*);
  60. void *    bsearch (const void *, const void *, size_t, 
  61.            size_t, int (*ptf)(const void*, const void*));
  62. void*     calloc(size_t, size_t);
  63. void      cfree(void*);
  64. int       chdir(const char*);
  65. int       chmod(const char*, int);
  66. int       chown(const char*, int, int);
  67. long      clock(void); /* should be clock_t really  */
  68. int       close(int);
  69. #ifdef DGUX
  70. int       creat(char*, unsigned long int);
  71. #else
  72. int       creat(const char*, unsigned long int);
  73. #endif
  74. /* char*     crypt(const char*, const char*); POHC */
  75. char*     ctermid(char*);
  76. char*     cuserid(char*);
  77. double    drand48(void);
  78. int       dup(int);
  79. int       dup2(int, int);
  80. int       dysize(int);
  81. char*     ecvt(double, int, int*, int*);
  82. char*     encrypt(char*, int);
  83. double    erand(short*);
  84. int       execl(const char *, const char *, ...);
  85. int       execle(const char *, const char *, ...);
  86. int       execlp(const char *, const char *, ...);
  87. int       execv(const char *,  const char **);
  88. int       execve(const char *, const char **, const char **);
  89. int       execvp(const char *,  const char **);
  90. void volatile exit(int);
  91. int       fchmod(int, int);
  92. int       fchown(int, int, int);
  93. int       fcntl(int, int, ...);
  94. char*     fcvt(double, int, int*, int*);
  95. int       ffs(int);
  96. int       flock(int, int);
  97. int       fork(void);
  98. void      free(void*);
  99. int       fsync(int);
  100. long      ftok(const char*, int);
  101. int       ftruncate(int, unsigned long);
  102. char*     gcvt(double, int, char*);
  103. char*     getcwd(char*, int);
  104. int       getdomainname(char*, int);
  105. int       getdtablesize(void);
  106. int       getegid(void);
  107. char*     getenv(const char*);
  108. int       geteuid(void);
  109. int       getgid(void);
  110. int       getgroups(int, int*);
  111. long      gethostid(void);
  112. int       gethostname(char*, int);
  113. char*     getlogin(void);
  114. /* int       getopt(int, char* const*, const char*); */
  115. int       getpagesize(void);
  116. char*     getpass(const char*);
  117. /* int       getpgrp(); */
  118. int       getpid(void);
  119. int       getppid(void);
  120. int       getpriority(int, int);
  121. int       getpw(int, char*);
  122. /* unsigned  getuid(void); */
  123. char*     getwd(char*);
  124. char*     initstate(unsigned, char*, int);
  125. /* int       ioctl(int, int, char*); POHC */
  126. int       isatty(int);
  127. long      jrand48(short*);
  128. int       kill(int, int);
  129. int       killpg(int, int);
  130. void      lcong48(short*);
  131. int       link(const char*, const char*);
  132. int       listen(int, int);
  133. /* int       lock(int, int, long); */
  134. long      lrand48(void);
  135. long      lseek(int, long, int);
  136. void*     malloc(size_t);
  137. unsigned  malloc_usable_size(void*);
  138. void*     memalign(unsigned, unsigned);
  139. void*     memccpy(void*, const void*, int, size_t);
  140. void*     memmove(void*, const void*, size_t);
  141. void*     memchr(const void*, int, size_t);
  142. int       memcmp(const void*, const void*, size_t);
  143. void*     memcpy(void*, const void*, size_t);
  144. void*     _memcpy(void*, const void*, int); /* doesn't use movsb */
  145. void*     memset(void*, int, size_t);
  146. int       mkdir(const char*, int);
  147. int       mknod(const char*, int, int);
  148. int       mkstemp(char*);
  149. char*     mktemp(char*);
  150. long      mrand48(void);
  151. int       nice(int);
  152. long      nrand48(short*);
  153. #ifdef DGUX
  154. int       open(char*, int, ...);
  155. #else
  156. int       open(const char*, int, ...);
  157. #endif
  158. void volatile pause(void);
  159. void      perror(const char*);
  160. int       pipe(int*);
  161. int       profil(char*, int, int, int);
  162. void      psignal(unsigned, const char*);
  163. int       putenv(const char*);
  164. void      qsort(void*, size_t, size_t, int (*ptf)(const void*,const void*));
  165. int       rand(void);
  166. long      random(void);
  167. int       read(int, void*, unsigned);
  168. int       readlink(const char*, char*, int);
  169. void*     realloc(void*, size_t);
  170. int       remove(const char *);
  171. int       rename(const char*, const char*);
  172. int       rmdir(const char*);               
  173. void*     sbrk(int);              
  174. short*    seed48(short*);
  175. /* int       send(int, char*, int, int); POHC */
  176. int       setgid(int);
  177. int       sethostname(char*, int);
  178. int       setkey(const char*);
  179. /* int       setpgrp(); */
  180. int       setpriority(int, int, int);
  181. int       setregid(int, int);
  182. int       setreuid(int, int);
  183. char*     setstate(char*);
  184. int       setuid(int);
  185. int       sigblock(int);
  186. int       siginterrupt(int, int);
  187. int       sigpause(int);
  188. int       sigsetmask(int);
  189. unsigned  sleep(unsigned);
  190. int       socket(int, int, int);
  191. void      srand(int);
  192. void      srand48(long);
  193. void      srandom(int);
  194. int       stime(long*);
  195. int       strcasecmp(const char *, const char *);
  196. char*     strcat(char*, const char*);
  197. char*     strchr(const char*, int);
  198. int       strcmp(const char*, const char*);
  199. char*     strcpy(char*, const char*);
  200. size_t    strcspn(const char*, const char*);
  201. char*     strdup(const char*);
  202. char*     strerror(int);
  203. size_t    strftime(char *, size_t, const char *, struct tm *);
  204. int       stricmp(const char *, const char *);
  205. size_t    strlen(const char*);
  206. char*     strlwr(char *);
  207. int       strncasecmp(const char *, const char *, size_t);
  208. char*     strncat(char*, const char*, size_t);
  209. int       strncmp(const char*, const char*, size_t);
  210. char*     strncpy(char*, const char*, size_t);
  211. int       strnicmp(const char *, const char *, size_t);
  212. char*     strpbrk(const char*, const char*);
  213. char*     strrchr(const char*, int);
  214. size_t     strspn(const char*, const char*);
  215. char*     strstr(const char*, const char*);
  216. double    strtod(const char*, char**);
  217. char*     strtok(char*, const char*);
  218. long      strtol(const char*, char**, int);
  219. unsigned long strtoul(const char*, char**, int);
  220. char*     strupr(char *);
  221. void      swab(void*, void*, int);
  222. int       symlink(const char*, const char*);
  223. int       syscall(int, ...);
  224. int       system(const char*);
  225. char*     tempnam(const char*, const char*);
  226. int       tgetent(char*, char*);
  227. int       tgetnum(char*);
  228. int       tgetflag(char*);
  229. char*     tgetstr(char *, char **);
  230. char*     tgoto(char*, int, int);
  231. unsigned long      time(unsigned long*);
  232. char*     tmpnam(char*);
  233. /* int       tputs(char *, int, int (*)()); */
  234. int       truncate(const char*, unsigned long);
  235. char*     ttyname(int);
  236. int       ttyslot(void);
  237. unsigned  ualarm(unsigned, unsigned);
  238. long      ulimit(int, long);
  239. int       umask(int);
  240. int       unlink(const char*);
  241. unsigned  usleep(unsigned);
  242. int       vadvise(int);
  243. void*     valloc(unsigned);
  244. int       vfork(void);
  245. int       vhangup(void);
  246. int       wait(int*);
  247. int       write(int, const void*, unsigned);
  248.  
  249. #ifdef __cplusplus
  250. }
  251. #endif
  252.  
  253.  
  254. #ifdef __cplusplus
  255. extern "C" {
  256. #endif
  257. int       bcmp(const void*, const void*, int);
  258. void      bcopy(const void*, void*, int);
  259. void      _bcopy(const void*, void*, int); /* doesn't use movsb */
  260. void      bzero(void*, int);
  261. char*     index(const char*, int);
  262. char*     rindex(const char*, int);
  263. #ifdef __cplusplus
  264. }
  265. #endif
  266.  
  267. extern char**   environ;
  268. extern volatile int errno;
  269. extern char*    sys_errlist[];
  270. extern int      sys_nerr;                  
  271. extern char*    optarg;
  272. extern int      opterr;
  273. extern int      optind;
  274.  
  275.  
  276. #ifdef __cplusplus
  277. extern "C" {
  278. #endif
  279.  
  280. /* extern void* alloca(size_t); */
  281. #ifndef alloca
  282. #define alloca(x)  __builtin_alloca(x)
  283. #endif
  284. #ifndef __GNUC__
  285. extern char *__builtin_alloca (int);
  286. #endif
  287.  
  288. #ifdef __cplusplus
  289. }
  290. #endif
  291.  
  292. #undef volatile
  293.  
  294. #endif 
  295.